﻿using System;
namespace Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="detailandmed_kommertspant", Namespace="http://producers.arireg.xtee.riik.ee/producer/arireg", Target=typeof(DetailandmedKommertspant))]
    public class DetailandmedKommertspantSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IDetailandmedKommertspant clazz;
        
        public DetailandmedKommertspantSerializer(IDetailandmedKommertspant clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            if (clazz.KaardiPiirkond!=null) {
                Writer.WriteStartElement("kaardi_piirkond");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "int");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdInt(((int)(clazz.KaardiPiirkond))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.KaardiNr!=null) {
                Writer.WriteStartElement("kaardi_nr");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "int");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdInt(((int)(clazz.KaardiNr))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.KaardiTyyp!=null) {
                Writer.WriteStartElement("kaardi_tyyp");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KaardiTyyp))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.KandeNr!=null) {
                Writer.WriteStartElement("kande_nr");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "int");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdInt(((int)(clazz.KandeNr))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiId!=null) {
                Writer.WriteStartElement("pandi_id");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiId))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiNumber!=null) {
                Writer.WriteStartElement("pandi_number");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiNumber))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiOlek!=null) {
                Writer.WriteStartElement("pandi_olek");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiOlek))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiOlekTekstina!=null) {
                Writer.WriteStartElement("pandi_olek_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiOlekTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiJarjekoht!=null) {
                Writer.WriteStartElement("pandi_jarjekoht");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiJarjekoht))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiJarjekohtTekstina!=null) {
                Writer.WriteStartElement("pandi_jarjekoht_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiJarjekohtTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiSumma!=null) {
                Writer.WriteStartElement("pandi_summa");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiSumma))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiValuuta!=null) {
                Writer.WriteStartElement("pandi_valuuta");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiValuuta))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.PandiValuutaTekstina!=null) {
                Writer.WriteStartElement("pandi_valuuta_tekstina");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandiValuutaTekstina))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.AlgusKpv!=null) {
                Writer.WriteStartElement("algus_kpv");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.AlgusKpv))).ToString());
                Writer.WriteEndElement();
            }
            if (clazz.LoppKpv!=null) {
                Writer.WriteStartElement("lopp_kpv");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "date");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdDate(((System.DateTime)(clazz.LoppKpv))).ToString());
                Writer.WriteEndElement();
            }
            Writer.WriteStartElement("jarjekohad");
            if (clazz.Jarjekohad!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("detailandmed_kp_jarjekoht", "http://producers.arireg.xtee.riik.ee/producer/arireg", clazz.Jarjekohad.Count);
                for (int x = 0; ((clazz.Jarjekohad != null) 
                            && (x < clazz.Jarjekohad.Count)); x = (x + 1)) {
                    if (clazz.Jarjekohad[x]!=null) {
                        Writer.WriteStartElement("item");
                        global::Xtee.Core.SerializationMetadata metaJarjekohad = this.GetMetaData(clazz.Jarjekohad[x]);
                        Writer.WriteTypeAttribute(metaJarjekohad.TypeQualifiedName.Namespace, metaJarjekohad.TypeQualifiedName.Name);
                        metaJarjekohad.NewSerializer(clazz.Jarjekohad[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Jarjekohad");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("pandisummad");
            if (clazz.Pandisummad!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("detailandmed_kp_pandisumma", "http://producers.arireg.xtee.riik.ee/producer/arireg", clazz.Pandisummad.Count);
                for (int x = 0; ((clazz.Pandisummad != null) 
                            && (x < clazz.Pandisummad.Count)); x = (x + 1)) {
                    if (clazz.Pandisummad[x]!=null) {
                        Writer.WriteStartElement("item");
                        global::Xtee.Core.SerializationMetadata metaPandisummad = this.GetMetaData(clazz.Pandisummad[x]);
                        Writer.WriteTypeAttribute(metaPandisummad.TypeQualifiedName.Namespace, metaPandisummad.TypeQualifiedName.Name);
                        metaPandisummad.NewSerializer(clazz.Pandisummad[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Pandisummad");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("pandipidajad");
            if (clazz.Pandipidajad!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("detailandmed_kp_pandipidaja", "http://producers.arireg.xtee.riik.ee/producer/arireg", clazz.Pandipidajad.Count);
                for (int x = 0; ((clazz.Pandipidajad != null) 
                            && (x < clazz.Pandipidajad.Count)); x = (x + 1)) {
                    if (clazz.Pandipidajad[x]!=null) {
                        Writer.WriteStartElement("item");
                        global::Xtee.Core.SerializationMetadata metaPandipidajad = this.GetMetaData(clazz.Pandipidajad[x]);
                        Writer.WriteTypeAttribute(metaPandipidajad.TypeQualifiedName.Namespace, metaPandipidajad.TypeQualifiedName.Name);
                        metaPandipidajad.NewSerializer(clazz.Pandipidajad[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Pandipidajad");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("markused");
            if (clazz.Markused!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("detailandmed_kp_markus", "http://producers.arireg.xtee.riik.ee/producer/arireg", clazz.Markused.Count);
                for (int x = 0; ((clazz.Markused != null) 
                            && (x < clazz.Markused.Count)); x = (x + 1)) {
                    if (clazz.Markused[x]!=null) {
                        Writer.WriteStartElement("item");
                        global::Xtee.Core.SerializationMetadata metaMarkused = this.GetMetaData(clazz.Markused[x]);
                        Writer.WriteTypeAttribute(metaMarkused.TypeQualifiedName.Namespace, metaMarkused.TypeQualifiedName.Name);
                        metaMarkused.NewSerializer(clazz.Markused[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Markused");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="kaardi_piirkond") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>kaardi_piirkond");
                }
                clazz.KaardiPiirkond = new global::Xtee.Core.Schema.XsdInt(Reader.ReadElementString("kaardi_piirkond")).Value;
            }
            if (Reader.LocalName=="kaardi_nr") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>kaardi_nr");
                }
                clazz.KaardiNr = new global::Xtee.Core.Schema.XsdInt(Reader.ReadElementString("kaardi_nr")).Value;
            }
            if (Reader.LocalName=="kaardi_tyyp") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>kaardi_tyyp");
                }
                clazz.KaardiTyyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kaardi_tyyp")).Value;
            }
            if (Reader.LocalName=="kande_nr") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>kande_nr");
                }
                clazz.KandeNr = new global::Xtee.Core.Schema.XsdInt(Reader.ReadElementString("kande_nr")).Value;
            }
            if (Reader.LocalName=="pandi_id") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_id");
                }
                clazz.PandiId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_id")).Value;
            }
            if (Reader.LocalName=="pandi_number") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_number");
                }
                clazz.PandiNumber = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_number")).Value;
            }
            if (Reader.LocalName=="pandi_olek") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_olek");
                }
                clazz.PandiOlek = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_olek")).Value;
            }
            if (Reader.LocalName=="pandi_olek_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_olek_tekstina");
                }
                clazz.PandiOlekTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_olek_tekstina")).Value;
            }
            if (Reader.LocalName=="pandi_jarjekoht") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_jarjekoht");
                }
                clazz.PandiJarjekoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_jarjekoht")).Value;
            }
            if (Reader.LocalName=="pandi_jarjekoht_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_jarjekoht_tekstina");
                }
                clazz.PandiJarjekohtTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_jarjekoht_tekstina")).Value;
            }
            if (Reader.LocalName=="pandi_summa") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_summa");
                }
                clazz.PandiSumma = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_summa")).Value;
            }
            if (Reader.LocalName=="pandi_valuuta") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_valuuta");
                }
                clazz.PandiValuuta = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_valuuta")).Value;
            }
            if (Reader.LocalName=="pandi_valuuta_tekstina") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandi_valuuta_tekstina");
                }
                clazz.PandiValuutaTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandi_valuuta_tekstina")).Value;
            }
            if (Reader.LocalName=="algus_kpv") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>algus_kpv");
                }
                clazz.AlgusKpv = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("algus_kpv")).Value;
            }
            if (Reader.LocalName=="lopp_kpv") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>lopp_kpv");
                }
                clazz.LoppKpv = new global::Xtee.Core.Schema.XsdDate(Reader.ReadElementString("lopp_kpv")).Value;
            }
            if (Reader.LocalName=="jarjekohad") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>jarjekohad");
                }
                clazz.Jarjekohad = new System.Collections.Generic.List<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpJarjekoht>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("jarjekohad");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "item")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kp_jarjekohad>item");
                        }
                        global::Xtee.Core.SerializationMetadata metaJarjekohad = this.GetMetaData<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpJarjekoht>(Reader, "detailandmed_kp_jarjekoht", "http://producers.arireg.xtee.riik.ee/producer/arireg");
                        global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpJarjekoht item = metaJarjekohad.NewEntity<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpJarjekoht>();
                        clazz.Jarjekohad.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("item");
                            metaJarjekohad.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>detailandmed_kommertspant>jarjekohad", Reader.LocalName);
            }
            if (Reader.LocalName=="pandisummad") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandisummad");
                }
                clazz.Pandisummad = new System.Collections.Generic.List<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpPandisumma>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("pandisummad");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "item")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kp_pandisummad>item");
                        }
                        global::Xtee.Core.SerializationMetadata metaPandisummad = this.GetMetaData<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpPandisumma>(Reader, "detailandmed_kp_pandisumma", "http://producers.arireg.xtee.riik.ee/producer/arireg");
                        global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpPandisumma item = metaPandisummad.NewEntity<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpPandisumma>();
                        clazz.Pandisummad.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("item");
                            metaPandisummad.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>detailandmed_kommertspant>pandisummad", Reader.LocalName);
            }
            if (Reader.LocalName=="pandipidajad") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>pandipidajad");
                }
                clazz.Pandipidajad = new System.Collections.Generic.List<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpPandipidaja>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("pandipidajad");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "item")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kp_pandipidajad>item");
                        }
                        global::Xtee.Core.SerializationMetadata metaPandipidajad = this.GetMetaData<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpPandipidaja>(Reader, "detailandmed_kp_pandipidaja", "http://producers.arireg.xtee.riik.ee/producer/arireg");
                        global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpPandipidaja item = metaPandipidajad.NewEntity<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpPandipidaja>();
                        clazz.Pandipidajad.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("item");
                            metaPandipidajad.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>detailandmed_kommertspant>pandipidajad", Reader.LocalName);
            }
            if (Reader.LocalName=="markused") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kommertspant>markused");
                }
                clazz.Markused = new System.Collections.Generic.List<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpMarkus>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("markused");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "item")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>detailandmed_kp_markused>item");
                        }
                        global::Xtee.Core.SerializationMetadata metaMarkused = this.GetMetaData<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpMarkus>(Reader, "detailandmed_kp_markus", "http://producers.arireg.xtee.riik.ee/producer/arireg");
                        global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpMarkus item = metaMarkused.NewEntity<global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IDetailandmedKpMarkus>();
                        clazz.Markused.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("item");
                            metaMarkused.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>detailandmed_kommertspant>markused", Reader.LocalName);
            }
        }
    }
}
